import nyNetwork from "@/api/nyBaseNetwork";

class DZModelArticle {

    /**
     * 文章ID
     */
    id = "";

    /**
     * 文章类别ID
     */
    typeId = "";

    /**
     * 文章类别名称
     */
    typeName = "";

    /**
     * 文章标题
     */
    title = "";

    /**
     * 文章描述
     */
    des = "";

    /**
     * 列表封面ID
     */
    listCover = "";

    /**
     * 列表封面路径
     */
    listCoverUrl = "";

    /**
     * 内容bannerID
     */
    bannerCover = "";

    /**
     * 内容banner路径
     */
    bannerCoverUrl = "";

    /**
     * 文章内容，富文本
     */
    content = "";

    /**
     * 文章浏览量
     */
    lookNum = "";

    sort = "";

    top = "";

    parse(data) {
        this.typeId = data.iTypeId + '' ?? '';
        this.title = data.sTitle ?? '';
        this.des = data.sDes ?? '';
        this.listCover = data.iListId;
        if (data.iListId) {
            this.listCoverUrl = nyNetwork.image(data.iListId);
        }
        this.bannerCover = data.iBannerId;
        if (data.iBannerId) {
            this.bannerCoverUrl = nyNetwork.image(data.iBannerId);
        }
        this.content = data.sContent ?? '';
        this.sort = data.iSort ?? 0;
        this.top = data.iTop ?? 0;
    }


}
export default DZModelArticle;